;;; TESTS



(defparameter *test*
  "foobar
zoo spam:<%= (+ 1 2) %>
<% (dolist (i '(1 2 3)) %>
  n: <%= i %>
<% ) %>
hohoho!
")




(defun t-transform-string ()
  (transform-string *test*))


(defun t-run-string (s)
  (funcall (eval (read-from-string s))))

(defun t-run-all-string ()
  (t-run-string (t-transform-string)))




(defun t-raw-lambda ()
  (eval (read-from-string (t-transform-string))))

(defun t-compiled-string ()
  (flet ((compile-string () (compile nil (t-raw-lambda))))
    (let ((fun (first (multiple-value-list (compile-string)))))
      fun)))


(defun t-run-compiled-string ()
  (funcall (t-compiled-string)))




#|
(let ((foo nil))
  (setf foo (capture-output 
              (format t "foobar")
              (format t "zoospam")))
  (format t "[~a]~%" foo))


(macroexpand-1 
  '(capture-output (format t "foobar")))
|#

